home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / RSTRSCRN.PAS < prev    next >
Pascal/Delphi Source File  |  1988-07-17  |  1KB  |  37 lines

  1. {->>>>RestoreScreen<<<<----------------------------------------}
  2. {                                                              }
  3. { Filename : RSTRSCRN.SRC -- Last Modified 7/14/88             }
  4. {                                                              }
  5. { This routine accepts a pointer generated by the SaveScreen   }
  6. { routine and brings back the saved display buffer from the    }
  7. { heap and loads it into the refresh buffer of the display     }
  8. { card.                                                        }
  9. {                                                              }
  10. {     From: COMPLETE TURBO PASCAL 5.0  by Jeff Duntemann       }
  11. {    Scott, Foresman & Co., Inc. 1988   ISBN 0-673-38355-5     }
  12. {--------------------------------------------------------------}
  13.  
  14. PROCEDURE RestoreScreen(StashPtr : Pointer);
  15.  
  16. TYPE
  17.   VidPtr   = ^VidSaver;
  18.   VidSaver = RECORD
  19.                Base,Size : Word;
  20.                BufStart  : Byte
  21.              END;
  22.  
  23. VAR
  24.   VidVector : VidPtr;
  25.   VidBuffer : Pointer;
  26.   DataSize  : Word;
  27.  
  28. BEGIN
  29.   VidVector := StashPtr;  { Cast generic pointer onto VidSaver pointer }
  30.   DataSize  := VidVector^.Size;
  31.   { Create a pointer to the base of the video buffer: }
  32.   VidBuffer := Ptr(VidVector^.Base,0);
  33.   { Move the buffer portion of the data on the heap to the video buffer: }
  34.   Move(VidVector^.BufStart,VidBuffer^,VidVector^.Size);
  35.   FreeMem(StashPtr,DataSize + 4);
  36. END;
  37.